package com.project.junM.controller;

import com.project.junM.entity.TVaccinNote;
import com.project.junM.service.VaccinNoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.Map;

@RestController
@RequestMapping("/vaccinNote")
@CrossOrigin
public class VaccinNoteController {

    @Autowired
    private VaccinNoteService vaccinNoteService;

    @PostMapping("insertSelective")
    public boolean insertSelective(@RequestBody Map<String,TVaccinNote> map, HttpSession session){
        return vaccinNoteService.insertSelective(map.get("vaccinNote"),session);
    }

    @GetMapping("/queryByIdCard1")
    public boolean queryByIdCard1(String vaccinIdCard){
        return vaccinNoteService.selectByVaccinIdCard1(vaccinIdCard);
    }

    @GetMapping("/queryByIdCard2")
    public boolean queryByIdCard2(@RequestBody Map<String,String> map){
        return vaccinNoteService.selectByVaccinIdCard2(map.get("vaccinIdCard"),Integer.valueOf(map.get("vaccinDeptId")),Integer.valueOf(map.get("vaccinCount")));
    }

}
